<!DOCTYPE htm1>
<htm1 lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>6.4</title>
</head>
<body>
    <script>
    //定义数组
    var arr = [1,2,3,4,5,6,7,8,9,10];

    //获取指定值
    console.log(arr[0],'获取指定值')

    //移除数组尾部元素
    arr.pop();
    console.log(arr, '移除数组尾部元素')

    //头部移除元素
    arr.shift();
    console.log(arr,'头部移除元素')

    //splice   新增 删除修改数组元素

    //删除
    let arr1 = [1,2,3,4,5,6,7,8,9,10];
    arr1.splice(1,2);
    console.log(art, 'splice方法')

    


    </script>
</body>
</htm1>